package com.leyou.item.mapper;

import com.leyou.item.pojo.Brand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

public interface BrandMapper extends Mapper<Brand> {

    /**
     * 新增品牌与分类关联信息
     * @param cid 分类ID
     * @param bid 品牌ID
     * @return
     */
    @Insert("INSERT INTO TB_CATEGORY_BRAND (CATEGORY_ID, BRAND_ID) VALUES (#{cid},#{bid})")
    int insertCategoryBrand(@Param("cid") Long cid,@Param("bid") Long bid);

    @Delete("DELETE FROM TB_CATEGORY_BRAND WHERE BRAND_ID = #{bid}")
    int deleteCategoryBrandByBid(Long bid);
}
